package com.gopay.common.domain.cust;

import java.util.Date;

import javax.persistence.*;

import com.gopay.common.cipher.utils.LoggerMaskUtils;
import com.gopay.common.domain.BaseEntity;

@Entity
@Table(name = "CUST_INFO_AUDIT")
public class CustInfoAudit extends BaseEntity {

	private static final long serialVersionUID = 7613606464662198006L;


	private Long id;

    private String custId;
    private int version;
    private String custType;
    private String field;
    private String fieldName;
    private String fieldBefore;
    private String fieldAfter;
    private String auditStat;
    private String refuseReason;
    private Date auditTs;
    private Date createdTs;
    private Date lastUpdTs;
    private String operId;
    private String auditId;
    private String email;
    private String mobile;
    private String fieldBeforeName;
    private String fieldAfterName;

    @Id
    @Column(name = "ID")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "Cust_Info_Audit_SEQ")
    @SequenceGenerator(name = "Cust_Info_Audit_SEQ", allocationSize = 1, initialValue = 1, sequenceName = "Cust_Info_Audit_SEQ")
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name = "CUST_ID", unique = true, nullable = false, length = 10)
    public String getCustId() {
        return this.custId;
    }

    public void setCustId(String custId) {
        this.custId = custId;
    }

    @Version
    @Column(name = "VERSION", nullable = false, precision = 22, scale = 0)
    public int getVersion() {
        return this.version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    @Column(name = "CUST_TYPE", nullable = false, length = 2)
    public String getCustType() {
        return custType;
    }

    public void setCustType(String custType) {
        this.custType = custType;
    }

    @Column(name = "FIELD", nullable = false, length = 20)
    public String getField() {
        return field;
    }

    public void setField(String field) {
        this.field = field;
    }

    @Column(name = "FIELD_NAME", nullable = false, length = 20)
    public String getFieldName() {
        return fieldName;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    @Column(name = "FIELD_BEFORE", nullable = true, length = 3000)
    public String getFieldBefore() {
        return fieldBefore;
    }

    public void setFieldBefore(String fieldBefore) {
        this.fieldBefore = fieldBefore;
    }

    @Column(name = "FIELD_AFTER", nullable = true, length = 3000)
    public String getFieldAfter() {
        return fieldAfter;
    }

    public void setFieldAfter(String fieldAfter) {
        this.fieldAfter = fieldAfter;
    }

    @Column(name = "AUDIT_STAT", nullable = false, length = 2)
    public String getAuditStat() {
        return auditStat;
    }

    public void setAuditStat(String auditStat) {
        this.auditStat = auditStat;
    }

    @Column(name = "REFUSE_REASON", nullable = true, length = 200)
    public String getRefuseReason() {
        return refuseReason;
    }

    public void setRefuseReason(String refuseReason) {
        this.refuseReason = refuseReason;
    }

    @Column(name = "AUDIT_TS")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getAuditTs() {
        return auditTs;
    }

    public void setAuditTs(Date auditTs) {
        this.auditTs = auditTs;
    }

    @Column(name = "CREATED_TS")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getCreatedTs() {
        return this.createdTs;
    }

    public void setCreatedTs(Date createdTs) {
        this.createdTs = createdTs;
    }

    @Column(name = "LAST_UPD_TS")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getLastUpdTs() {
        return this.lastUpdTs;
    }

    public void setLastUpdTs(Date lastUpdTs) {
        this.lastUpdTs = lastUpdTs;
    }

    @Column(name = "OPER_ID", nullable = false, length = 64)
    public String getOperId() {
        return operId;
    }

    public void setOperId(String operId) {
        this.operId = operId;
    }

    @Column(name = "AUDIT_ID", nullable = true, length = 64)
    public String getAuditId() {
        return auditId;
    }

    public void setAuditId(String auditId) {
        this.auditId = auditId;
    }

    @Transient
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Transient
    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    @Transient
    public String getFieldBeforeName() {
        return fieldBeforeName;
    }

    public void setFieldBeforeName(String fieldBeforeName) {
        this.fieldBeforeName = fieldBeforeName;
    }

    @Transient
    public String getFieldAfterName() {
        return fieldAfterName;
    }

    public void setFieldAfterName(String fieldAfterName) {
        this.fieldAfterName = fieldAfterName;
    }

	@Override
	public String toString() {
		return "CustInfoAudit [id=" + id + ", custId=" + custId + ", version=" + version + ", custType=" + custType
				+ ", field=" + field + ", fieldName=" + fieldName + ", fieldBefore=" + fieldBefore + ", fieldAfter="
				+ fieldAfter + ", auditStat=" + auditStat + ", refuseReason=" + refuseReason + ", auditTs=" + auditTs
				+ ", createdTs=" + createdTs + ", lastUpdTs=" + lastUpdTs + ", operId=" + operId + ", auditId="
				+ auditId + ", email=" + email + ", mobile=" + LoggerMaskUtils.maskString(mobile) + ", fieldBeforeName=" + LoggerMaskUtils.maskString(fieldBeforeName)
				+ ", fieldAfterName=" + LoggerMaskUtils.maskString(fieldAfterName) + "]";
	}
    
    
    
}
